﻿using System.Collections.Generic;
using System.Linq;

namespace PMS.Services.EntityServices.Customers
{
    /// <summary>
    /// Change password result
    /// </summary>
    public class ChangePasswordResult
    {
        public ChangePasswordResult()
        {
            Errors = new List<(string, string)>();
        }

        /// <summary>
        /// Gets a value indicating whether request has been completed successfully
        /// </summary>
        public bool Success => !Errors.Any();

        /// <summary>
        /// Add error
        /// </summary>
        /// <param name="error">Error</param>
        public void AddError(string key, string error)
        {
            Errors.Add((key,error));
        }

        /// <summary>
        /// Errors
        /// </summary>
        public IList<(string,string)> Errors { get; set; }
    }

}
